<template>
    <div class="big-screen-container">
      <!-- 这里放置您的大屏内容 -->
      <div class="screen-header">
        <h1>电池性能监控大屏</h1>
        <div class="time">{{ currentTime }}</div>
      </div>
  
      <div class="screen-content">
        <!-- 示例：添加一些图表和统计信息 -->
        <div class="chart-container">
          <div class="chart-item">
            <h3>充电状态统计</h3>
            <div class="chart-placeholder">图表区域</div>
          </div>
          <div class="chart-item">
            <h3>放电状态统计</h3>
            <div class="chart-placeholder">图表区域</div>
          </div>
          <div class="chart-item">
            <h3>温度分布</h3>
            <div class="chart-placeholder">图表区域</div>
          </div>
          <div class="chart-item">
            <h3>性能指标</h3>
            <div class="chart-placeholder">图表区域</div>
          </div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    name: "BigScreen",
    data() {
      return {
        currentTime: "",
        timer: null
      };
    },
    mounted() {
      this.updateTime();
      this.timer = setInterval(this.updateTime, 1000);
  
      // 这里可以添加获取大屏数据的逻辑
      this.fetchData();
    },
    beforeDestroy() {
      if (this.timer) {
        clearInterval(this.timer);
      }
    },
    methods: {
      updateTime() {
        const now = new Date();
        this.currentTime = now.toLocaleString();
      },
      fetchData() {
        // 这里添加获取大屏数据的API调用
        // 例如：getBigScreenData().then(res => { ... })
      }
    }
  };
  </script>
  
  <style scoped>
  .big-screen-container {
    width: 100vw;
    height: 100vh;
    background-color: #0f1c30;
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .screen-header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: rgba(13, 25, 49, 0.8);
  }
  
  .screen-header h1 {
    margin: 0;
    font-size: 24px;
  }
  
  .screen-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
  }
  
  .chart-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    height: 100%;
  }
  
  .chart-item {
    background-color: rgba(13, 25, 49, 0.6);
    border: 1px solid rgba(0, 159, 233, 0.3);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
  }
  
  .chart-item h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #00fffc;
    font-size: 18px;
  }
  
  .chart-placeholder {
    flex: 1;
    background-color: rgba(0, 159, 233, 0.1);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
  }
  </style>
  